<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - ged.info - test/utils/iterator/token_iterator.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../../index.html">directory</a> - <a href="index.html">test/utils/iterator</a> - token_iterator.hpp</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>ged.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2009-06-09</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">82</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">1.2 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">1</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : //  (C) Copyright Gennadiy Rozental 2004-2008.
<span class="lineNum">       2 </span>                : //  Distributed under the Boost Software License, Version 1.0.
<span class="lineNum">       3 </span>                : //  (See accompanying file LICENSE_1_0.txt or copy at 
<span class="lineNum">       4 </span>                : //  http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">       5 </span>                : 
<span class="lineNum">       6 </span>                : //  See http://www.boost.org/libs/test for the library home page.
<span class="lineNum">       7 </span>                : //
<span class="lineNum">       8 </span>                : //  File        : $RCSfile$
<span class="lineNum">       9 </span>                : //
<span class="lineNum">      10 </span>                : //  Version     : $Revision: 49312 $
<span class="lineNum">      11 </span>                : //
<span class="lineNum">      12 </span>                : //  Description : token iterator for string and range tokenization
<span class="lineNum">      13 </span>                : // ***************************************************************************
<span class="lineNum">      14 </span>                : 
<span class="lineNum">      15 </span>                : #ifndef BOOST_TOKEN_ITERATOR_HPP_071894GER
<span class="lineNum">      16 </span>                : #define BOOST_TOKEN_ITERATOR_HPP_071894GER
<span class="lineNum">      17 </span>                : 
<span class="lineNum">      18 </span>                : // Boost
<span class="lineNum">      19 </span>                : #include &lt;boost/config.hpp&gt;
<span class="lineNum">      20 </span>                : #include &lt;boost/detail/workaround.hpp&gt;
<span class="lineNum">      21 </span>                : 
<span class="lineNum">      22 </span>                : #include &lt;boost/iterator/iterator_categories.hpp&gt;
<span class="lineNum">      23 </span>                : #include &lt;boost/iterator/iterator_traits.hpp&gt;
<span class="lineNum">      24 </span>                : 
<span class="lineNum">      25 </span>                : #include &lt;boost/test/utils/iterator/input_iterator_facade.hpp&gt;
<span class="lineNum">      26 </span>                : #include &lt;boost/test/utils/basic_cstring/basic_cstring.hpp&gt;
<span class="lineNum">      27 </span>                : #include &lt;boost/test/utils/named_params.hpp&gt;
<span class="lineNum">      28 </span>                : #include &lt;boost/test/utils/foreach.hpp&gt;
<span class="lineNum">      29 </span>                : 
<span class="lineNum">      30 </span>                : // STL
<span class="lineNum">      31 </span>                : #include &lt;iosfwd&gt;
<span class="lineNum">      32 </span>                : #include &lt;cctype&gt;
<span class="lineNum">      33 </span>                : 
<span class="lineNum">      34 </span>                : #include &lt;boost/test/detail/suppress_warnings.hpp&gt;
<span class="lineNum">      35 </span>                : 
<span class="lineNum">      36 </span>                : //____________________________________________________________________________//
<span class="lineNum">      37 </span>                : 
<span class="lineNum">      38 </span>                : #ifdef BOOST_NO_STDC_NAMESPACE
<span class="lineNum">      39 </span>                : namespace std{ using ::ispunct; using ::isspace; }
<span class="lineNum">      40 </span>                : #endif
<span class="lineNum">      41 </span>                : 
<span class="lineNum">      42 </span>                : namespace boost {
<span class="lineNum">      43 </span>                : 
<span class="lineNum">      44 </span>                : namespace unit_test {
<span class="lineNum">      45 </span>                : 
<span class="lineNum">      46 </span>                : // ************************************************************************** //
<span class="lineNum">      47 </span>                : // **************               ti_delimeter_type              ************** //
<span class="lineNum">      48 </span>                : // ************************************************************************** //
<span class="lineNum">      49 </span>                : 
<span class="lineNum">      50 </span>                : enum ti_delimeter_type { 
<span class="lineNum">      51 </span>                :     dt_char,        // character is delimeter if it among explicit list of some characters
<span class="lineNum">      52 </span>                :     dt_ispunct,     // character is delimeter if it satisfies ispunct functor
<span class="lineNum">      53 </span>                :     dt_isspace,     // character is delimeter if it satisfies isspace functor
<span class="lineNum">      54 </span>                :     dt_none         // no character is delimeter
<span class="lineNum">      55 </span>                : };
<span class="lineNum">      56 </span>                : 
<span class="lineNum">      57 </span>                : namespace ut_detail {
<span class="lineNum">      58 </span>                : 
<span class="lineNum">      59 </span>                : // ************************************************************************** //
<span class="lineNum">      60 </span>                : // **************             default_char_compare             ************** //
<span class="lineNum">      61 </span>                : // ************************************************************************** //
<span class="lineNum">      62 </span>                : 
<span class="lineNum">      63 </span>                : template&lt;typename CharT&gt;
<span class="lineNum">      64 </span>                : class default_char_compare {
<span class="lineNum">      65 </span>                : public:
<span class="lineNum">      66 </span><span class="lineNoCov">              0 :     bool operator()( CharT c1, CharT c2 )</span>
<span class="lineNum">      67 </span>                :     {
<span class="lineNum">      68 </span>                : #ifdef BOOST_CLASSIC_IOSTREAMS
<span class="lineNum">      69 </span>                :         return std::string_char_traits&lt;CharT&gt;::eq( c1, c2 );
<span class="lineNum">      70 </span>                : #else
<span class="lineNum">      71 </span><span class="lineNoCov">              0 :         return std::char_traits&lt;CharT&gt;::eq( c1, c2 );</span>
<span class="lineNum">      72 </span>                : #endif
<span class="lineNum">      73 </span>                :     }
<span class="lineNum">      74 </span>                : };
<span class="lineNum">      75 </span>                : 
<span class="lineNum">      76 </span>                : // ************************************************************************** //
<span class="lineNum">      77 </span>                : // **************                 delim_policy                 ************** //
<span class="lineNum">      78 </span>                : // ************************************************************************** //
<span class="lineNum">      79 </span>                : 
<span class="lineNum">      80 </span>                : template&lt;typename CharT,typename CharCompare&gt;
<span class="lineNum">      81 </span>                : class delim_policy {
<span class="lineNum">      82 </span>                :     typedef basic_cstring&lt;CharT const&gt; cstring;
<span class="lineNum">      83 </span>                : public:
<span class="lineNum">      84 </span>                :     // Constructor
<span class="lineNum">      85 </span><span class="lineNoCov">              0 :     explicit    delim_policy( ti_delimeter_type t = dt_char, cstring d = cstring() )</span>
<span class="lineNum">      86 </span><span class="lineNoCov">              0 :     : m_type( t )</span>
<span class="lineNum">      87 </span>                :     {
<span class="lineNum">      88 </span><span class="lineNoCov">              0 :         set_delimeters( d );</span>
<span class="lineNum">      89 </span><span class="lineNoCov">              0 :     }</span>
<span class="lineNum">      90 </span>                : 
<span class="lineNum">      91 </span><span class="lineNoCov">              0 :     void        set_delimeters( ti_delimeter_type t ) { m_type = t; }</span>
<span class="lineNum">      92 </span>                :     template&lt;typename Src&gt;
<span class="lineNum">      93 </span><span class="lineNoCov">              0 :     void        set_delimeters( Src d )</span>
<span class="lineNum">      94 </span>                :     {
<span class="lineNum">      95 </span><span class="lineNoCov">              0 :         nfp::optionally_assign( m_delimeters, d );</span>
<span class="lineNum">      96 </span>                :         
<span class="lineNum">      97 </span><span class="lineNoCov">              0 :         if( !m_delimeters.is_empty() )</span>
<span class="lineNum">      98 </span><span class="lineNoCov">              0 :             m_type = dt_char;</span>
<span class="lineNum">      99 </span><span class="lineNoCov">              0 :     }</span>
<span class="lineNum">     100 </span>                : 
<span class="lineNum">     101 </span><span class="lineNoCov">              0 :     bool        operator()( CharT c )</span>
<span class="lineNum">     102 </span>                :     {
<span class="lineNum">     103 </span><span class="lineNoCov">              0 :         switch( m_type ) {</span>
<span class="lineNum">     104 </span>                :         case dt_char: {
<span class="lineNum">     105 </span><span class="lineNoCov">              0 :             BOOST_TEST_FOREACH( CharT, delim, m_delimeters )</span>
<span class="lineNum">     106 </span><span class="lineNoCov">              0 :                 if( CharCompare()( delim, c ) )</span>
<span class="lineNum">     107 </span><span class="lineNoCov">              0 :                     return true;</span>
<span class="lineNum">     108 </span>                : 
<span class="lineNum">     109 </span><span class="lineNoCov">              0 :             return false;</span>
<span class="lineNum">     110 </span>                :         }
<span class="lineNum">     111 </span>                :         case dt_ispunct:
<span class="lineNum">     112 </span><span class="lineNoCov">              0 :             return (std::ispunct)( c ) != 0;</span>
<span class="lineNum">     113 </span>                :         case dt_isspace:
<span class="lineNum">     114 </span><span class="lineNoCov">              0 :             return (std::isspace)( c ) != 0;</span>
<span class="lineNum">     115 </span>                :         case dt_none:
<span class="lineNum">     116 </span><span class="lineNoCov">              0 :             return false;</span>
<span class="lineNum">     117 </span>                :         }
<span class="lineNum">     118 </span>                : 
<span class="lineNum">     119 </span><span class="lineNoCov">              0 :         return false;</span>
<span class="lineNum">     120 </span>                :     }
<span class="lineNum">     121 </span>                : 
<span class="lineNum">     122 </span>                : private:
<span class="lineNum">     123 </span>                :     // Data members
<span class="lineNum">     124 </span>                :     cstring             m_delimeters;
<span class="lineNum">     125 </span>                :     ti_delimeter_type   m_type;
<span class="lineNum">     126 </span>                : };
<span class="lineNum">     127 </span>                : 
<span class="lineNum">     128 </span>                : // ************************************************************************** //
<span class="lineNum">     129 </span>                : // **************                 token_assigner               ************** //
<span class="lineNum">     130 </span>                : // ************************************************************************** //
<span class="lineNum">     131 </span>                : 
<span class="lineNum">     132 </span>                : template&lt;typename TraversalTag&gt;
<span class="lineNum">     133 </span>                : struct token_assigner {
<span class="lineNum">     134 </span>                : #if BOOST_WORKAROUND( BOOST_DINKUMWARE_STDLIB, &lt; 306 )
<span class="lineNum">     135 </span>                :     template&lt;typename Iterator, typename C, typename T&gt;
<span class="lineNum">     136 </span>                :     static void assign( Iterator b, Iterator e, std::basic_string&lt;C,T&gt;&amp; t )
<span class="lineNum">     137 </span>                :     { for( ; b != e; ++b ) t += *b; }
<span class="lineNum">     138 </span>                :     
<span class="lineNum">     139 </span>                :     template&lt;typename Iterator, typename C&gt;
<span class="lineNum">     140 </span>                :     static void assign( Iterator b, Iterator e, basic_cstring&lt;C&gt;&amp; t )  { t.assign( b, e ); }
<span class="lineNum">     141 </span>                : #else
<span class="lineNum">     142 </span>                :     template&lt;typename Iterator, typename Token&gt;
<span class="lineNum">     143 </span><span class="lineNoCov">              0 :     static void assign( Iterator b, Iterator e, Token&amp; t )  { t.assign( b, e ); }</span>
<span class="lineNum">     144 </span>                : #endif
<span class="lineNum">     145 </span>                :     template&lt;typename Iterator, typename Token&gt;
<span class="lineNum">     146 </span><span class="lineNoCov">              0 :     static void append_move( Iterator&amp; b, Token&amp; )          { ++b; }</span>
<span class="lineNum">     147 </span>                : };
<span class="lineNum">     148 </span>                : 
<span class="lineNum">     149 </span>                : //____________________________________________________________________________//
<span class="lineNum">     150 </span>                : 
<span class="lineNum">     151 </span>                : template&lt;&gt;
<span class="lineNum">     152 </span>                : struct token_assigner&lt;single_pass_traversal_tag&gt; {
<span class="lineNum">     153 </span>                :     template&lt;typename Iterator, typename Token&gt;
<span class="lineNum">     154 </span>                :     static void assign( Iterator b, Iterator e, Token&amp; t )  {}
<span class="lineNum">     155 </span>                : 
<span class="lineNum">     156 </span>                :     template&lt;typename Iterator, typename Token&gt;
<span class="lineNum">     157 </span>                :     static void append_move( Iterator&amp; b, Token&amp; t )        { t += *b; ++b; }
<span class="lineNum">     158 </span>                : };
<span class="lineNum">     159 </span>                : 
<span class="lineNum">     160 </span>                : } // namespace ut_detail
<span class="lineNum">     161 </span>                : 
<span class="lineNum">     162 </span>                : // ************************************************************************** //
<span class="lineNum">     163 </span>                : // **************                  modifiers                   ************** //
<span class="lineNum">     164 </span>                : // ************************************************************************** //
<span class="lineNum">     165 </span>                : 
<span class="lineNum">     166 </span>                : namespace {
<span class="lineNum">     167 </span>                : nfp::keyword&lt;struct dropped_delimeters_t &gt;           dropped_delimeters;
<span class="lineNum">     168 </span>                : nfp::keyword&lt;struct kept_delimeters_t &gt;              kept_delimeters;
<span class="lineNum">     169 </span><span class="lineCov">              2 : nfp::typed_keyword&lt;bool,struct keep_empty_tokens_t &gt; keep_empty_tokens;</span>
<span class="lineNum">     170 </span>                : nfp::typed_keyword&lt;std::size_t,struct max_tokens_t &gt; max_tokens;
<span class="lineNum">     171 </span>                : }
<span class="lineNum">     172 </span>                : 
<span class="lineNum">     173 </span>                : // ************************************************************************** //
<span class="lineNum">     174 </span>                : // **************             token_iterator_base              ************** //
<span class="lineNum">     175 </span>                : // ************************************************************************** //
<span class="lineNum">     176 </span>                : 
<span class="lineNum">     177 </span>                : template&lt;typename Derived,
<span class="lineNum">     178 </span>                :          typename CharT,
<span class="lineNum">     179 </span>                :          typename CharCompare   = ut_detail::default_char_compare&lt;CharT&gt;,
<span class="lineNum">     180 </span>                :          typename ValueType     = basic_cstring&lt;CharT const&gt;,
<span class="lineNum">     181 </span>                :          typename Reference     = basic_cstring&lt;CharT const&gt;,
<span class="lineNum">     182 </span>                :          typename Traversal     = forward_traversal_tag&gt;
<span class="lineNum">     183 </span>                : class token_iterator_base
<span class="lineNum">     184 </span>                : : public input_iterator_facade&lt;Derived,ValueType,Reference,Traversal&gt; {
<span class="lineNum">     185 </span>                :     typedef basic_cstring&lt;CharT const&gt;                                      cstring;
<span class="lineNum">     186 </span>                :     typedef ut_detail::delim_policy&lt;CharT,CharCompare&gt;                      delim_policy;
<span class="lineNum">     187 </span>                :     typedef input_iterator_facade&lt;Derived,ValueType,Reference,Traversal&gt;    base;
<span class="lineNum">     188 </span>                : 
<span class="lineNum">     189 </span>                : protected:
<span class="lineNum">     190 </span>                :     // Constructor
<span class="lineNum">     191 </span><span class="lineNoCov">              0 :     explicit    token_iterator_base()</span>
<span class="lineNum">     192 </span>                :     : m_is_dropped( dt_isspace )
<span class="lineNum">     193 </span>                :     , m_is_kept( dt_ispunct )
<span class="lineNum">     194 </span>                :     , m_keep_empty_tokens( false )
<span class="lineNum">     195 </span>                :     , m_tokens_left( (std::size_t)-1 )
<span class="lineNum">     196 </span><span class="lineNoCov">              0 :     , m_token_produced( false )</span>
<span class="lineNum">     197 </span>                :     {
<span class="lineNum">     198 </span><span class="lineNoCov">              0 :     }</span>
<span class="lineNum">     199 </span>                : 
<span class="lineNum">     200 </span>                :     template&lt;typename Modifier&gt;
<span class="lineNum">     201 </span>                :     void
<span class="lineNum">     202 </span><span class="lineNoCov">              0 :     apply_modifier( Modifier const&amp; m )</span>
<span class="lineNum">     203 </span>                :     {
<span class="lineNum">     204 </span><span class="lineNoCov">              0 :         if( m.has( dropped_delimeters ) )</span>
<span class="lineNum">     205 </span><span class="lineNoCov">              0 :             m_is_dropped.set_delimeters( m[dropped_delimeters] );</span>
<span class="lineNum">     206 </span>                : 
<span class="lineNum">     207 </span><span class="lineNoCov">              0 :         if( m.has( kept_delimeters ) )</span>
<span class="lineNum">     208 </span><span class="lineNoCov">              0 :             m_is_kept.set_delimeters( m[kept_delimeters] );</span>
<span class="lineNum">     209 </span>                : 
<span class="lineNum">     210 </span><span class="lineNoCov">              0 :         if( m.has( keep_empty_tokens ) )</span>
<span class="lineNum">     211 </span><span class="lineNoCov">              0 :             m_keep_empty_tokens = true;</span>
<span class="lineNum">     212 </span>                : 
<span class="lineNum">     213 </span><span class="lineNoCov">              0 :         nfp::optionally_assign( m_tokens_left, m, max_tokens );</span>
<span class="lineNum">     214 </span><span class="lineNoCov">              0 :     }</span>
<span class="lineNum">     215 </span>                : 
<span class="lineNum">     216 </span>                :     template&lt;typename Iter&gt; 
<span class="lineNum">     217 </span><span class="lineNoCov">              0 :     bool                    get( Iter&amp; begin, Iter end )</span>
<span class="lineNum">     218 </span>                :     {
<span class="lineNum">     219 </span>                :         typedef ut_detail::token_assigner&lt;BOOST_DEDUCED_TYPENAME iterator_traversal&lt;Iter&gt;::type&gt; Assigner;
<span class="lineNum">     220 </span>                :         Iter check_point;
<span class="lineNum">     221 </span>                : 
<span class="lineNum">     222 </span><span class="lineNoCov">              0 :         this-&gt;m_value.clear();</span>
<span class="lineNum">     223 </span>                : 
<span class="lineNum">     224 </span><span class="lineNoCov">              0 :         if( !m_keep_empty_tokens ) {</span>
<span class="lineNum">     225 </span><span class="lineNoCov">              0 :             while( begin != end &amp;&amp; m_is_dropped( *begin ) )</span>
<span class="lineNum">     226 </span><span class="lineNoCov">              0 :                 ++begin;</span>
<span class="lineNum">     227 </span>                : 
<span class="lineNum">     228 </span><span class="lineNoCov">              0 :             if( begin == end )</span>
<span class="lineNum">     229 </span><span class="lineNoCov">              0 :                 return false;</span>
<span class="lineNum">     230 </span>                : 
<span class="lineNum">     231 </span><span class="lineNoCov">              0 :             check_point = begin;</span>
<span class="lineNum">     232 </span>                : 
<span class="lineNum">     233 </span><span class="lineNoCov">              0 :             if( m_tokens_left == 1 )</span>
<span class="lineNum">     234 </span><span class="lineNoCov">              0 :                 while( begin != end )</span>
<span class="lineNum">     235 </span><span class="lineNoCov">              0 :                     Assigner::append_move( begin, this-&gt;m_value );</span>
<span class="lineNum">     236 </span><span class="lineNoCov">              0 :             else if( m_is_kept( *begin ) )</span>
<span class="lineNum">     237 </span><span class="lineNoCov">              0 :                 Assigner::append_move( begin, this-&gt;m_value );</span>
<span class="lineNum">     238 </span>                :             else
<span class="lineNum">     239 </span><span class="lineNoCov">              0 :                 while( begin != end &amp;&amp; !m_is_dropped( *begin ) &amp;&amp; !m_is_kept( *begin ) )</span>
<span class="lineNum">     240 </span><span class="lineNoCov">              0 :                     Assigner::append_move( begin, this-&gt;m_value );</span>
<span class="lineNum">     241 </span>                : 
<span class="lineNum">     242 </span><span class="lineNoCov">              0 :             --m_tokens_left;</span>
<span class="lineNum">     243 </span>                :         } 
<span class="lineNum">     244 </span>                :         else { // m_keep_empty_tokens is true
<span class="lineNum">     245 </span><span class="lineNoCov">              0 :             check_point = begin;</span>
<span class="lineNum">     246 </span>                : 
<span class="lineNum">     247 </span><span class="lineNoCov">              0 :             if( begin == end ) {</span>
<span class="lineNum">     248 </span><span class="lineNoCov">              0 :                 if( m_token_produced ) </span>
<span class="lineNum">     249 </span><span class="lineNoCov">              0 :                     return false;</span>
<span class="lineNum">     250 </span>                : 
<span class="lineNum">     251 </span><span class="lineNoCov">              0 :                 m_token_produced = true;</span>
<span class="lineNum">     252 </span>                :             }
<span class="lineNum">     253 </span><span class="lineNoCov">              0 :             if( m_is_kept( *begin ) ) {</span>
<span class="lineNum">     254 </span><span class="lineNoCov">              0 :                 if( m_token_produced ) </span>
<span class="lineNum">     255 </span><span class="lineNoCov">              0 :                     Assigner::append_move( begin, this-&gt;m_value );</span>
<span class="lineNum">     256 </span>                : 
<span class="lineNum">     257 </span><span class="lineNoCov">              0 :                 m_token_produced = !m_token_produced;</span>
<span class="lineNum">     258 </span>                :             } 
<span class="lineNum">     259 </span><span class="lineNoCov">              0 :             else if( !m_token_produced &amp;&amp; m_is_dropped( *begin ) )</span>
<span class="lineNum">     260 </span><span class="lineNoCov">              0 :                 m_token_produced = true;</span>
<span class="lineNum">     261 </span>                :             else {
<span class="lineNum">     262 </span><span class="lineNoCov">              0 :                 if( m_is_dropped( *begin ) )</span>
<span class="lineNum">     263 </span><span class="lineNoCov">              0 :                     check_point = ++begin;</span>
<span class="lineNum">     264 </span>                : 
<span class="lineNum">     265 </span><span class="lineNoCov">              0 :                 while( begin != end &amp;&amp; !m_is_dropped( *begin ) &amp;&amp; !m_is_kept( *begin ) )</span>
<span class="lineNum">     266 </span><span class="lineNoCov">              0 :                     Assigner::append_move( begin, this-&gt;m_value );</span>
<span class="lineNum">     267 </span>                : 
<span class="lineNum">     268 </span><span class="lineNoCov">              0 :                 m_token_produced = true;</span>
<span class="lineNum">     269 </span>                :             }
<span class="lineNum">     270 </span>                :         }
<span class="lineNum">     271 </span>                : 
<span class="lineNum">     272 </span><span class="lineNoCov">              0 :         Assigner::assign( check_point, begin, this-&gt;m_value );</span>
<span class="lineNum">     273 </span>                : 
<span class="lineNum">     274 </span><span class="lineNoCov">              0 :         return true;</span>
<span class="lineNum">     275 </span>                :     }
<span class="lineNum">     276 </span>                : 
<span class="lineNum">     277 </span>                : private:
<span class="lineNum">     278 </span>                :     // Data members
<span class="lineNum">     279 </span>                :     delim_policy            m_is_dropped;
<span class="lineNum">     280 </span>                :     delim_policy            m_is_kept;
<span class="lineNum">     281 </span>                :     bool                    m_keep_empty_tokens;
<span class="lineNum">     282 </span>                :     std::size_t             m_tokens_left;
<span class="lineNum">     283 </span>                :     bool                    m_token_produced;
<span class="lineNum">     284 </span>                : };
<span class="lineNum">     285 </span>                : 
<span class="lineNum">     286 </span>                : // ************************************************************************** //
<span class="lineNum">     287 </span>                : // **************          basic_string_token_iterator         ************** //
<span class="lineNum">     288 </span>                : // ************************************************************************** //
<span class="lineNum">     289 </span>                : 
<span class="lineNum">     290 </span>                : template&lt;typename CharT,
<span class="lineNum">     291 </span>                :          typename CharCompare = ut_detail::default_char_compare&lt;CharT&gt; &gt;
<span class="lineNum">     292 </span>                : class basic_string_token_iterator
<span class="lineNum">     293 </span>                : : public token_iterator_base&lt;basic_string_token_iterator&lt;CharT,CharCompare&gt;,CharT,CharCompare&gt; {
<span class="lineNum">     294 </span>                :     typedef basic_cstring&lt;CharT const&gt; cstring;
<span class="lineNum">     295 </span>                :     typedef token_iterator_base&lt;basic_string_token_iterator&lt;CharT,CharCompare&gt;,CharT,CharCompare&gt; base;
<span class="lineNum">     296 </span>                : public:
<span class="lineNum">     297 </span><span class="lineNoCov">              0 :     explicit    basic_string_token_iterator() {}</span>
<span class="lineNum">     298 </span>                :     explicit    basic_string_token_iterator( cstring src )
<span class="lineNum">     299 </span>                :     : m_src( src )
<span class="lineNum">     300 </span>                :     {
<span class="lineNum">     301 </span>                :         this-&gt;init();
<span class="lineNum">     302 </span>                :     }
<span class="lineNum">     303 </span>                : 
<span class="lineNum">     304 </span>                :     template&lt;typename Src, typename Modifier&gt;
<span class="lineNum">     305 </span><span class="lineNoCov">              0 :     basic_string_token_iterator( Src src, Modifier const&amp; m )</span>
<span class="lineNum">     306 </span><span class="lineNoCov">              0 :     : m_src( src )</span>
<span class="lineNum">     307 </span>                :     {
<span class="lineNum">     308 </span><span class="lineNoCov">              0 :         this-&gt;apply_modifier( m );</span>
<span class="lineNum">     309 </span>                : 
<span class="lineNum">     310 </span><span class="lineNoCov">              0 :         this-&gt;init();</span>
<span class="lineNum">     311 </span><span class="lineNoCov">              0 :     }</span>
<span class="lineNum">     312 </span>                : 
<span class="lineNum">     313 </span>                : private:
<span class="lineNum">     314 </span>                :     friend class input_iterator_core_access;
<span class="lineNum">     315 </span>                : 
<span class="lineNum">     316 </span>                :     // input iterator implementation
<span class="lineNum">     317 </span><span class="lineNoCov">              0 :     bool        get()</span>
<span class="lineNum">     318 </span>                :     {
<span class="lineNum">     319 </span><span class="lineNoCov">              0 :         typename cstring::iterator begin = m_src.begin();</span>
<span class="lineNum">     320 </span><span class="lineNoCov">              0 :         bool res = base::get( begin, m_src.end() );</span>
<span class="lineNum">     321 </span>                : 
<span class="lineNum">     322 </span><span class="lineNoCov">              0 :         m_src.assign( begin, m_src.end() );</span>
<span class="lineNum">     323 </span>                : 
<span class="lineNum">     324 </span><span class="lineNoCov">              0 :         return res;</span>
<span class="lineNum">     325 </span>                :     }
<span class="lineNum">     326 </span>                : 
<span class="lineNum">     327 </span>                :     // Data members
<span class="lineNum">     328 </span>                :     cstring     m_src;
<span class="lineNum">     329 </span>                : };
<span class="lineNum">     330 </span>                : 
<span class="lineNum">     331 </span>                : typedef basic_string_token_iterator&lt;char&gt;       string_token_iterator;
<span class="lineNum">     332 </span>                : typedef basic_string_token_iterator&lt;wchar_t&gt;    wstring_token_iterator;
<span class="lineNum">     333 </span>                : 
<span class="lineNum">     334 </span>                : // ************************************************************************** //
<span class="lineNum">     335 </span>                : // **************              range_token_iterator            ************** //
<span class="lineNum">     336 </span>                : // ************************************************************************** //
<span class="lineNum">     337 </span>                : 
<span class="lineNum">     338 </span>                : template&lt;typename Iter,
<span class="lineNum">     339 </span>                :          typename CharCompare = ut_detail::default_char_compare&lt;BOOST_DEDUCED_TYPENAME iterator_value&lt;Iter&gt;::type&gt;,
<span class="lineNum">     340 </span>                :          typename ValueType   = std::basic_string&lt;BOOST_DEDUCED_TYPENAME iterator_value&lt;Iter&gt;::type&gt;,
<span class="lineNum">     341 </span>                :          typename Reference   = ValueType const&amp;&gt;
<span class="lineNum">     342 </span>                : class range_token_iterator
<span class="lineNum">     343 </span>                : : public token_iterator_base&lt;range_token_iterator&lt;Iter,CharCompare,ValueType,Reference&gt;,
<span class="lineNum">     344 </span>                :                              typename iterator_value&lt;Iter&gt;::type,CharCompare,ValueType,Reference&gt; {
<span class="lineNum">     345 </span>                :     typedef basic_cstring&lt;typename ValueType::value_type&gt; cstring;
<span class="lineNum">     346 </span>                :     typedef token_iterator_base&lt;range_token_iterator&lt;Iter,CharCompare,ValueType,Reference&gt;,
<span class="lineNum">     347 </span>                :                                 typename iterator_value&lt;Iter&gt;::type,CharCompare,ValueType,Reference&gt; base;
<span class="lineNum">     348 </span>                : public:
<span class="lineNum">     349 </span>                :     explicit    range_token_iterator() {}
<span class="lineNum">     350 </span>                :     explicit    range_token_iterator( Iter begin, Iter end = Iter() )
<span class="lineNum">     351 </span>                :     : m_begin( begin ), m_end( end )
<span class="lineNum">     352 </span>                :     {
<span class="lineNum">     353 </span>                :         this-&gt;init();
<span class="lineNum">     354 </span>                :     }
<span class="lineNum">     355 </span>                :     range_token_iterator( range_token_iterator const&amp; rhs )
<span class="lineNum">     356 </span>                :     : base( rhs )
<span class="lineNum">     357 </span>                :     {
<span class="lineNum">     358 </span>                :         if( this-&gt;m_valid ) {
<span class="lineNum">     359 </span>                :             m_begin = rhs.m_begin;
<span class="lineNum">     360 </span>                :             m_end   = rhs.m_end;
<span class="lineNum">     361 </span>                :         }
<span class="lineNum">     362 </span>                :     }
<span class="lineNum">     363 </span>                : 
<span class="lineNum">     364 </span>                :     template&lt;typename Modifier&gt;
<span class="lineNum">     365 </span>                :     range_token_iterator( Iter begin, Iter end, Modifier const&amp; m )
<span class="lineNum">     366 </span>                :     : m_begin( begin ), m_end( end )
<span class="lineNum">     367 </span>                :     {
<span class="lineNum">     368 </span>                :         this-&gt;apply_modifier( m );
<span class="lineNum">     369 </span>                : 
<span class="lineNum">     370 </span>                :         this-&gt;init();
<span class="lineNum">     371 </span>                :     }
<span class="lineNum">     372 </span>                : 
<span class="lineNum">     373 </span>                : private:
<span class="lineNum">     374 </span>                :     friend class input_iterator_core_access;
<span class="lineNum">     375 </span>                : 
<span class="lineNum">     376 </span>                :     // input iterator implementation
<span class="lineNum">     377 </span>                :     bool        get()
<span class="lineNum">     378 </span>                :     {
<span class="lineNum">     379 </span>                :         return base::get( m_begin, m_end );
<span class="lineNum">     380 </span>                :     }
<span class="lineNum">     381 </span>                : 
<span class="lineNum">     382 </span>                :     // Data members
<span class="lineNum">     383 </span>                :     Iter m_begin;
<span class="lineNum">     384 </span>                :     Iter m_end;
<span class="lineNum">     385 </span>                : };
<span class="lineNum">     386 </span>                : 
<span class="lineNum">     387 </span>                : // ************************************************************************** //
<span class="lineNum">     388 </span>                : // **************            make_range_token_iterator         ************** //
<span class="lineNum">     389 </span>                : // ************************************************************************** //
<span class="lineNum">     390 </span>                : 
<span class="lineNum">     391 </span>                : template&lt;typename Iter&gt;
<span class="lineNum">     392 </span>                : inline range_token_iterator&lt;Iter&gt;
<span class="lineNum">     393 </span>                : make_range_token_iterator( Iter begin, Iter end = Iter() )
<span class="lineNum">     394 </span>                : {
<span class="lineNum">     395 </span>                :     return range_token_iterator&lt;Iter&gt;( begin, end );
<span class="lineNum">     396 </span>                : }
<span class="lineNum">     397 </span>                : 
<span class="lineNum">     398 </span>                : //____________________________________________________________________________//
<span class="lineNum">     399 </span>                : 
<span class="lineNum">     400 </span>                : template&lt;typename Iter,typename Modifier&gt;
<span class="lineNum">     401 </span>                : inline range_token_iterator&lt;Iter&gt;
<span class="lineNum">     402 </span>                : make_range_token_iterator( Iter begin, Iter end, Modifier const&amp; m )
<span class="lineNum">     403 </span>                : {
<span class="lineNum">     404 </span>                :     return range_token_iterator&lt;Iter&gt;( begin, end, m );
<span class="lineNum">     405 </span>                : }
<span class="lineNum">     406 </span>                : 
<span class="lineNum">     407 </span>                : //____________________________________________________________________________//
<span class="lineNum">     408 </span>                : 
<span class="lineNum">     409 </span>                : } // namespace unit_test
<span class="lineNum">     410 </span>                : 
<span class="lineNum">     411 </span>                : } // namespace boost
<span class="lineNum">     412 </span>                : 
<span class="lineNum">     413 </span>                : //____________________________________________________________________________//
<span class="lineNum">     414 </span>                : 
<span class="lineNum">     415 </span>                : #include &lt;boost/test/detail/enable_warnings.hpp&gt;
<span class="lineNum">     416 </span>                : 
<span class="lineNum">     417 </span>                : #endif // BOOST_TOKEN_ITERATOR_HPP_071894GER
<span class="lineNum">     418 </span>                : 
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
